package cn.bgs.service.impl;

import cn.bgs.config.DirectXyConfig;
import cn.bgs.mapper.OfferAdviceMapper;
import cn.bgs.pojo.OfferAdvice;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @program: town-digital
 * @description:
 * @author: Mr.Zhao
 * @create: 2022-08-10 20:14
 */
@Component
public class DircetReciveXyOfferAdviceService {

    private static final Logger log = LoggerFactory.getLogger(DircetReciveXyOfferAdviceService.class);

    @Autowired
    private OfferAdviceMapper offerAdviceMapper;

    @RabbitListener(queues = DirectXyConfig.DIRECT_QUEUE_NAME)
    public void recivexy(OfferAdvice msg){

        UpdateWrapper<OfferAdvice> updateWrapper = new UpdateWrapper<>();
        updateWrapper.eq("id",msg.getId()).set("offer_state","已回复");
        offerAdviceMapper.update(null, updateWrapper);




    }
}
